package com.yanfan.access.service.impl;

import java.util.Arrays;
import java.util.List;
import com.yanfan.common.utils.DateUtils;
import com.yanfan.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanfan.access.mapper.NjAccessChannelInfoMapper;
import com.yanfan.access.domain.NjAccessChannelInfo;
import com.yanfan.access.service.INjAccessChannelInfoService;

/**
 * 通道信息Service业务层处理
 *
 * @author genluo
 * @date 2024-10-30
 */
@Service
public class NjAccessChannelInfoServiceImpl extends ServiceImpl<NjAccessChannelInfoMapper, NjAccessChannelInfo> implements INjAccessChannelInfoService {
    @Autowired
    private NjAccessChannelInfoMapper njAccessChannelInfoMapper;


    /**
     * 查询通道信息列表
     *
     * @param njAccessChannelInfo 通道信息
     * @return 通道信息
     */
    @Override
    public List<NjAccessChannelInfo> queryPageList(NjAccessChannelInfo njAccessChannelInfo) {
        LambdaQueryWrapper<NjAccessChannelInfo> lqw = buildQueryWrapper(njAccessChannelInfo);
        return njAccessChannelInfoMapper.selectList(lqw);
        //连表查询可用该方法，在此方法SQL语句上进行扩展
        //return njAccessChannelInfoMapper.queryPageList(njAccessChannelInfo);
    }

    /**
    * 分页查询条件
    * @return
    */
    private LambdaQueryWrapper<NjAccessChannelInfo> buildQueryWrapper(NjAccessChannelInfo bo) {
        LambdaQueryWrapper<NjAccessChannelInfo> lqw = Wrappers.lambdaQuery();
        lqw.like(StringUtils.isNotBlank(bo.getChannelName()), NjAccessChannelInfo::getChannelName, bo.getChannelName());
        return lqw;
    }



}
